﻿namespace SSP.Api.Options
{
    /// <summary>
    /// 
    /// </summary>
    public abstract class BaseFormatOptions
    {
        /// <summary>
        /// Gets or sets the crop.
        /// </summary>
        /// <value>The crop.</value>
        public int crop { get; set; }
        /// <summary>
        /// Gets or sets the height.
        /// </summary>
        /// <value>The height.</value>
        public int height { get; set; }
        /// <summary>
        /// Gets or sets the quality.
        /// </summary>
        /// <value>The quality.</value>
        public int quality { get; set; }
        /// <summary>
        /// Gets or sets the sharpening.
        /// </summary>
        /// <value>The sharpening.</value>
        public int sharpening { get; set; }
        /// <summary>
        /// Gets or sets the width.
        /// </summary>
        /// <value>The width.</value>
        public int width { get; set; }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public abstract override string ToString();

        /// <summary>
        /// Queries the string.
        /// </summary>
        /// <returns></returns>
        protected string QueryString()
        {
            return string.Join(",", new[]
                                        {
                                            width.ToString(),
                                            height.ToString(),
                                            crop.ToString(),
                                            quality.ToString(),
                                            sharpening.ToString()
                                        });
        }
    }
}